package mmc.networking;

import mmc.RemoteServer;
import mmc.server.RemoteClient;

@SuppressWarnings("serial")
public class Ping extends Message {

	public long time = System.nanoTime();
	
	@Override
	public void executeOnServer(RemoteClient context) {
		long diff = System.nanoTime()-time;
		context.getPlayer().currentPing = diff*1e-9;
	}
	
	@Override
	public void executeOnClient(RemoteServer context) {
		context.post(this);
	}
}